package cn.daomeng.firebird.core.log;

import cn.daomeng.firebird.core.exception.FirebirdException;
import cn.daomeng.firebird.core.utils.LogUtils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 默认日志服务类
 *
 * @author wf.shu
 * @version 1.0.0.0
 * @since 2019-03-08 15:09
 */
public class LogDefaultServiceImpl implements ILogService {
    private final static Logger logger = LoggerFactory.getLogger(LogDefaultServiceImpl.class);

    public void info(String message) {
        logger.info(message);
    }

    public void info(String message, FirebirdException e) {
        logger.info(message, e);
    }

    public void info(String message, FirebirdException e, Object... objects) {
        message = LogUtils.format(String.valueOf(message), objects);
        info(message, e);
    }

    public void info(String message, Object... objects) {
        logger.info(message, objects);
    }

    public void error(String message) {
        logger.error(message);
    }

    public void error(String message, FirebirdException e) {
        logger.error(message, e);
    }

    public void error(String message, FirebirdException e, Object... objects) {
        message = LogUtils.format(String.valueOf(message), objects);
        error(message, e);
    }

    public void error(String message, Object... objects) {
        logger.error(message, objects);
    }
}
